<?php
// 本类由系统自动生成，仅供测试用途
namespace Home\Controller;
use Think\Controller;
class IndexController extends ApiController {
    public function login(){
        //username,是否已签到
        $UID = I('UID');
        $PWD = I('PWD');
        if($UID+$PWD==200){
           $this->json(array('code'=>200,'UserName'=>"luodan","Status"=>0,'msg'=>"login success",'List'=>array(array('UserName'=>'luodan','Time'=>'2015-1-9 19:33'),array('UserName'=>'wutian','Time'=>'2015-1-9 19:33'))));
        }
        else{
            $this->json(array('code'=>-100,'msg'=>"login failure"));
        }
        return $this->getJson();
    }

//    UID签到：签到成功或失败
     function sign()
     {
         $UID = I('UID');
         if($UID==100){
             $this->json(array('code'=>200,msg=>'签到成功！','List'=>array(array('UserName'=>'zk','Time'=>'2015-1-9 19:33'))));
         }else{
             $this->json(array('code'=>-100,msg=>'签到失败！'));
         }
         return $this->getJson();
     }
}